package com.kusiri.kframework.uibuilder
{
	import com.kusiri.kframework.component.property.IKfComponentPropertyEditor;
	import com.kusiri.kframework.metadata.KfComponentPropertyConfiguration;
	
	import flash.display.DisplayObject;
	
	import mx.containers.VBox;
	
	public class ComponentPropertyEdit extends VBox
	{
		protected var _editor : IKfComponentPropertyEditor
		public var configuration : KfComponentPropertyConfiguration;
		
		public function ComponentPropertyEdit()
		{
			super();
		}
		
		public function get editor() : IKfComponentPropertyEditor
		{
			return _editor;
		}
		
		override protected function commitProperties():void 
		{
			removeAllChildren();
			
			if (configuration) 
			{
				_editor = configuration.newEditor();
				addChild( _editor as DisplayObject);
			} 
			
    		super.commitProperties();
  		}

	}
}